<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var arr = 'naubf52bfauwfbu21516lamsj181idh'

    var tis = /f/g

    console.log(tis.exec(arr));
    console.log(tis.test(arr));

    // 字符串方法

    console.log(arr.search(tis));            // 下标
    console.log(arr.match(tis));             // 返回匹配到的数组
    console.log(arr.replace(tis,'*'));       // 匹配替换
    console.log(arr.split(tis));

</script>
</html>